-- stack: in -- format: 8 (HyperCard 1) -- flags: 0x1000 (none) -- protect password hash: 0 -- maximum user level: 5 (scripting) -- window: Rect(x1=0, y1=0, x2=0, y2=0) -- screen: Rect(x1=0, y1=0, x2=0, y2=0) -- card dimensions: w=0 h=0 -- scroll: x=0 y=0 -- background count: 1 -- first background id: 2659 -- card count: 3 -- first card id: 3199 -- list block id: 2122 -- print block id: 5117 -- font table block id: 0 -- style table block id: 0 -- free block count: 0 -- free size: 0 bytes -- total size: 102048 bytes -- stack block size: 18944 bytes -- created by hypercard version: 0x00000000 -- compacted by hypercard version: 0x00000000 -- modified by hypercard version: 0x00000000 -- opened by hypercard version: 0x00000000 -- patterns[0]: 0x0000000000000000 -- patterns[1]: 0x8000000008000000 -- patterns[2]: 0x8800220088002200 -- patterns[3]: 0x8888222288882222 -- patterns[4]: 0x88AA22AA88AA22AA -- patterns[5]: 0xCCAA33AACCAA33AA -- patterns[6]: 0xEEAABBAAEEAABBAA -- patterns[7]: 0xEEBBBBEEEEBBBBEE -- patterns[8]: 0xFFBBFFEEFFBBFFEE -- patterns[9]: 0xFFBBFFFFFFBBFFFF -- patterns[10]: 0x8010022001084004 -- patterns[11]: 0xFFFFFFFFFFFFFFFF -- patterns[12]: 0x8822882288228822 -- patterns[13]: 0x1122448811224488 -- patterns[14]: 0xC4800C6843023026 -- patterns[15]: 0xB130031BD8C00C8D -- patterns[16]: 0xAA00AA00AA00AA00 -- patterns[17]: 0x8822552288225522 -- patterns[18]: 0x8855225588552255 -- patterns[19]: 0x77DD77DD77DD77DD -- patterns[20]: 0x8000000000000000 -- patterns[21]: 0xAA55AA55AA55AA55 -- patterns[22]: 0x038448300C020101 -- patterns[23]: 0x8244394482010101 -- patterns[24]: 0x8814224188412214 -- patterns[25]: 0x8080413E080814E3 -- patterns[26]: 0x22048C7422179810 -- patterns[27]: 0xBE808808EB088880 -- patterns[28]: 0x25C8328964244C92 -- patterns[29]: 0xA29C41BE2AC914EB -- patterns[30]: 0x40A00000040A0000 -- patterns[31]: 0x8040200002040800 -- patterns[32]: 0xAA00800088008000 -- patterns[33]: 0xFF80808080808080 -- patterns[34]: 0x081C22C180010204 -- patterns[35]: 0xFF808080FF080808 -- patterns[36]: 0xF87422478F172271 -- patterns[37]: 0xBF00BFBFB0B0B0B0 -- patterns[38]: 0xFF7FBE5DA2418000 -- patterns[39]: 0xFAF5FAF5A050A050 -- checksum: 0x0 ----- HyperTalk script ----- ------------------------------------------ -- STACK SCRIPTS CONSISTING OF OPENERS, -- -- CLOSERS, IDLERS, DOMENUS & KEYTRAPS. -- ------------------------------------------ ------------------- -- OPENING STUFF -- ------------------- On OPENSTACK -- SHOW WATCH & DECLARE GLOBALS: set cursor to 4 global PK,UL,TA,BT,MW,master,titleMaster,starMaster global directorMaster,classMaster,labelMaster,window global installBtn,lineNo,cardNo,hiButton -- RECORD PREVIOUS STATUS & ADVISE OF DELAY: go to card "Opening" put "Loading the indices. This takes a few seconds..." put the powerKeys into PK put the userLevel into UL put the textArrows into TA put the blindTyping into BT hide menuBar -- ADJUST THE LOCK/UNLOCK MODALITIES: if the short name of bg btn id 153 = "Edit ON" then -- UNLOCK MODE: lock screen set the icon of bg btn id 153 to 1413 unlock screen set name of bg btn id 153 to "Edit ON" set powerKeys to true set userlevel to 1 else -- LOCK MODE: lock screen set the icon of bg btn id 153 to 13262 unlock screen set name of bg btn id 153 to "Edit OFF" set powerKeys to false set userlevel to 5 end if -- PUT LAST SESSION'S DATA INTO VARIABLES: put card field "Master" into master put card field "titleMaster" into titleMaster put card field "starMaster" into starMaster put card field "directorMaster" into directorMaster put card field "classMaster" into classMaster put card field "installBtn" into installBtn put card field "labelMaster" into fld "Label" put card field "labelMaster" into labelMaster put card field "lineNo" into lineNo put card field "cardNo" into cardNo put card field "hiButton" into hiButton send mouseUp to bkgnd btn hiButton put fld "Window" into window -- WARM UP OPENING CARDS: lock screen set lockmessages to true go to card "Credits" go to card cardNo if labelMaster ≠ empty or labelMaster ≠ return then put labelMaster into fld "Label" end if if window ≠ empty then put window into fld "Window" put item 2 of the abbrev date into field "Date" go to card "Opening" -- GO THROUGH OPENING SEQUENCE (LOCKS STILL ON!): if cardNo < "3" then put "3" into cardNo set cursor to 4 go to card "Credits" play TVstart unlock screen with visual dissolve fast put empty hide msg wait 15 ticks lock screen go to card cardNo play drawer unlock screen with visual dissolve fast set lockmessages to false End OPENSTACK ------------------ -- MORE OPENING -- ------------------ On OPENCARD -- DECLARE GLOBALS: global window,labelMaster -- FILL IN THOSE CONTAINERS IN NEED OF NEW DATA: if window ≠ empty then put window into field "Window" end if if labelmaster ≠ empty then put labelMaster into field "Label" end if put item 2 of the abbrev date into field "Date" unlock screen with visual dissolve fast End OPENCARD ----------------------- -- TRAPPING HANDLERS -- ----------------------- On IDLE -- DECLARE GLOBALS: global SEEKING,listOscrolls,master,hiTapeButton global hiButton,lineNo -- DO THE EDIT THING: if the optionKey is down and the commandKey is down then if the short name of bg btn id 153 = "Edit OFF" then pass idle end if send mouseUp to bg btn id 153 exit idle end if -- CHECK INDEX; MAKE SURE NOT EMPTY: if fld "Window" = empty then if master ≠ empty then send mouseUp to bg btn hiButton end if pass idle end if -- CHECK POWERKEYS if the powerKeys is true and the visible of message window is false then put InKey() into trapChar else exit idle end if -- TRAPPING RETURN if trapChar = return then if the visible of bg btn "Sort" is true then send mouseUp to bg btn "Sort" exit idle end if global hiButton,findIt set cursor to 4 if hiTapeButton is empty then send mouseUp to bkgnd btn id 132 exit idle else send mouseUp to bkgnd btn hiTapeButton exit idle end if end if -- TRAPPING ENTER: if chartonum(trapChar) = 3 then if the short name of bg btn id 153 = "Edit ON" then send mouseUp to bg btn id 153 end if if the tool is "browse tool" then choose button tool else if the tool is "button tool" then choose field tool else choose browse tool exit idle end if -- TRAPPING LEFT ARROWS: if chartonum(trapChar) = 28 then send mouseUp to bg btn "Prev" exit idle end if -- TRAPPING RIGHT ARROWS if chartonum(trapChar) = 29 then send mouseUp to bg btn "Next" exit idle end if -- IF CLASS INDEX IS SHOWING GET OUT: if hiButton = 33 then exit idle -- TRAPPING UP ARROWS if chartonum(trapChar) = 30 then send mouseUp to bkgnd btn "up" exit idle end if -- TRAPPING DOWN ARROWS if chartonum(trapChar) = 31 then send mouseUp to bkgnd btn "down" pass idle end if if chartonum(trapChar) ≥ 97 and ¬ -- LOWER CASE charToNum(trapChar) ≤ 122 then -- ALPHAS -- FIND OUT LINE NUMBER OF MASTER THAT TRAPCHAR IS ON: put char 1 to offset("∂" & trapchar,master) of master into firstLines put the number of lines in firstLines into lineNo -- POSITION THE TRAPCHAR LINE + 11 lock screen put line lineNo to lineNo + 11 of master into field "window" unlock screen with visual dissolve fast put empty into trapChar exit idle end if End IDLE ------------------- -- MORE TRAPPING -- ------------------- On MOUSEDOWN -- CHECKING TO SEE IF AN INDEXED FIELD -- WAS OPENED. IF SO, SEND CLOSE TO -- ACTIVATE INDEX ADJUSTMENT. global fieldIsOpen if fieldIsOpen is empty then pass mouseDown send closeField to fld fieldIsOpen put empty into fieldIsOpen pass mouseDown End MOUSEDOWN ------------------- -- MORE TRAPPING -- ------------------- On ARROWKEY whichArrow -- DECLARE GLOBALS: global hiButton -- TRAP RIGHT ARROW: if whichArrow = "right" then send mouseUp to bg btn "Next" exit arrowKey end if -- TRAP LEFT ARROW: if whichArrow = "left" then send mouseUp to bg btn "Prev" exit arrowkey end if -- TRAP UP ARROW: if whichArrow = "up" then send mouseUp to bkgnd btn "up" end if -- TRAP DOWN ARROW: if whichArrow = "down" then send mouseUp to bkgnd btn "down" end if End ARROWKEY ------------------- -- MORE TRAPPING -- ------------------- On DOMENU whichItem -- DECLARE GLOBALS: global nuCard,tempUL,tempPK,killCard -- TRAP THE FOUR MAJOR NAVIGATORS if whichItem = "FIRST" then if the shiftKey is down then -- ONLY WAY TO GET TO REAL FIRST CARD! go to first card exit doMenu end if lock screen go to card 3 -- FIRST DATA CARD! unlock screen with visual dissolve fast exit doMenu end if if whichItem = "PREV" then if the number of this card is 3 then go last -- SKIPS FIRST TWO CARDS else go prev end if exit doMenu end if if whichItem = "NEXT" then if the number of this card = the number of cards then go to card 3 -- SKIPS FIRST TWO CARDS else go next end if exit doMenu end if if whichItem = "LAST" then go last exit doMenu end if -- TRAP NEW CARD MENUITEM: if whichItem = "New Card" then if nuCard = 0 or nuCard is empty then answer "Recommend using the NEW button on the VCR." exit doMenu end if end if -- TRAP DELETE CARD MENUITEM: if whichItem = "Delete Card" then if killCard = 0 or killCard is empty then answer "Recommend using the KILL button on the VCR." exit doMenu end if end if -- TRAP CUT CARD MENUITEM: if whichItem = "Cut Card" then answer "No can do. Cutting cards messes up the index." exit doMenu end if -- TRAP COPY CARD MENUITEM: if whichItem = "Copy Card" then answer "Copying cards can mess up the index." pass doMenu end if -- TRAP PASTE CARD MENUITEM: if whichItem = "Paste Card" then answer "This card won't be indexed." pass doMenu end if -- TRAP NEW STACK MENUITEM: if whichItem = "New Stack..." then -- GET THE NAME OF THE NEW VIDEOSTAK: ask "What is the name of your new VideoStak?" with "VideoStak ◊ Mine" if IT is empty then exit doMenu -- ESTABLISH SOURCE/DESTINATION PATHNAME: set cursor to 4 put it into newName put the long name of this stack into levelName delete char 1 to 7 of levelName repeat with i = the number of chars in levelName down to 1 if char i of levelName = ":" then exit repeat delete char i of levelName end repeat put levelName & "VideoStak ◊ Don't Open 2" into sourceFile put levelName & newName into destinationFile -- THE GUY DE PICCIOTTO COPY FILE XCMD: copyfile sourceFile,destinationFile put the result into errorCode if errorCode = -2 then answer "Syntax error!" if errorCode = -1 then answer "Not enough memory to copy!" if errorCode = 1 then answer "Can't find VideoStak ◊ Don't Open 2!" if errorCode = 2 then answer "Can't create your new VideoStak file!" if errorCode = 4 then answer "Error reading VideoStak ◊ Don't Open 2!" if errorCode = 5 then answer "Error writing your new VideoStak file!" if errorCode = 3 then answer newName && "already exists!" with "Copy Over" or "New Name" or "Cancel" if IT = "Cancel" then exit doMenu if IT = "New Name" then doMenu "New Stack..." if IT = "Copy Over" then set cursor to 4 copyfile sourceFile,destinationFile,o put the result into errorCode if errorCode = -2 then answer "Syntax error!" if errorCode = -1 then answer "Not enough memory to copy!" if errorCode = 1 then answer "Can't find VideoStak ◊ Don't Open 2!" if errorCode = 2 then answer "Can't create your new VideoStak file!" if errorCode = 4 then answer "Error reading VideoStak ◊ Don't Open 2!" if errorCode = 5 then answer "Error writing your new VideoStak file!" go to destinationFile exit doMenu end if end if -- GO TO NEW VIDEOSTAK: go to destinationFile exit doMenu end if -- PASS THE DOMENU OR GET LOCKED OUT: pass doMenu End DOMENU ------------------- -- MORE TRAPPING -- ------------------- On ENTERKEY -- TRAPPING ENTERKEY AS A TOOL TOGGLER: if the tool is "browse tool" then choose button tool else if the tool is "button tool" then choose field tool else choose browse tool End ENTERKEY ------------------- -- CLOSING STUFF -- ------------------- On CLOSECARD -- DECLARE GLOBALS: global window,add2index,labelMaster -- MEMORIZE THE WINDOW FIELD & THEN DELETE: put field "window" into window put field "Label" into labelMaster lock screen put empty into field "window" put empty into field "Label" End CLOSECARD ------------------ -- MORE CLOSING -- ------------------ On CLOSESTACK -- DECLARE GLOBALS: global PK,UL,TA,BT,MW,cardNo,lineNo,master,hiButton global hiTapeButton,window,installBtn,titleMaster global starMaster,directorMaster,labelMaster -- IF CLOSING SEQUENCE IS APPROPRIATE, DO IT: if the short name of this card ≠ "Opening" then -- GET DATA NEEDED TO RESUME WHERE LEFT OFF: set cursor to 4 put the number of this card into cardNo -- PUT CARDS INTO RAM SO RUN FAST -- IN THE UNLOCKED CLOSING: set lockmessages to true go to card "Credits" go to card "Opening" go to card cardNo -- CLEAN OUT THE LAST CARD VIEWED: put empty into fld "Window" put empty into fld "Label" -- START UNLOCKED CLOSING: go to card "Credits" unlock screen with visual dissolve fast put empty into fld "Window" put empty into fld "Label" play drawer wait 20 ticks lock screen go to card "Opening" unlock screen with visual dissolve fast play TVStart put empty into fld "Window" put empty into fld "Label" set lockmessages to false end if -- PUT VITAL VARIABLES INTO FIELDS: put cardNo into card field "cardNo" put lineNo into card field "lineNo" put master into card field "master" put titleMaster into card field "titleMaster" put starMaster into card field "starMaster" put directorMaster into card field "directorMaster" put installBtn into card field "installBtn" put labelMaster into card field "labelMaster" put hiButton into card field "hiButton" -- PUT STUFF BACK THE WAY YOU FOUND IT: set the userlevel to UL set the powerKeys to PK set the textArrows to TA set the blindTyping to BT -- COMPACTION: if the freeSize of this stack/the size of this stack > .2 then answer "Want to compact the stack?" with "Yes" or "No" if it = "Yes" then go to this card domenu "Compact Stack" end if end if -- THE EFFECT TO USE ON THE WAY OUT: visual dissolve fast End CLOSESTACK